package ics414scuba;
import java.util.*;
import java.io.*;

/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
 * This is a prototype class of our Dive Group Calculator method(s)
 * Feel free to add in/implement other methods, just please make sure
 * to update comments as much as possible
 * @author Kent
 * @date 10/24/2014
 */
public class DiveGroupCalculatorTest {
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * Variables that will be used to store the user's inputs 
	 * These inputs will be used to plan out the user's dives
	 */
	private int 	userDepth;	//a int that will determine the depth input
	private String 	unit;		//a String that will determine if depth is in meters or feet
	private int 	userTime;	//a int that will determine the user time
        private int     userBreakTime; //a int that will determine the break time
	private char 	userGroup;  //a char that will return the dive group
	private int 	check; 		//a int that will determine if the user input is acceptable
	private int 	decompress; //a int that will represent the decompress time
        private char    userBreakGroup; //a char that will return the break group
        private int     userRepetiveTime; //a char that will return the repetive dive group
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * Constructor of the Dive Group Calculator test class
	 * It will save the parameters as the user inputs
	 * There are only groups from a - l in the NAUI dive table, 
	 * 	so I implemented it in the same way
	 */
	public DiveGroupCalculatorTest() {
		check = 0;
		decompress = 0;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the diver's depth
	 * @return user depth
	 */
	public int getUserDepth() {
		return userDepth;
	}
        
        /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the diver's break time
	 * @return break time
	 */
        public int getBreakTime(){
            return userBreakTime;
        }
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the diver's depth units
	 */
	public String getUnit(){
		return unit;
	}

	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the diver's dive time
	 */
	public int getUserTime(){
		return userTime;
	}
	

	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the diver's group
	 */
	public char getDiveGroup(){
		return userGroup;
	}
  
  /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the breeak group
	 */  
   public char getBreakGroup(){
     return this.userBreakGroup;
   }
   
   /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A getter method for the repeat dive time
	 */  
   public int getRediveTime(){
      int unit = 0;
      if(this.unit.equals("m")) unit =1;
     userRepetiveTime = residualNitrogenCalc(this.userBreakGroup, this.userDepth, unit);
     return userRepetiveTime;
   }
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A method that will return a boolean stating if the divers
	 * 	input is acceptable or not
	 * @return constraint
	 */
	public int getCheck(){
		return check;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
         * A method that will return the time it will require a diver
	 * 	to decompress their nitrogen levels in their body
	 */
	public int getDecompress(){
		return decompress;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A method that will set the constraint boolean
	 * @param set
	 */
	public void setCheck(int set){
		check = set;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method that will set what type
	 * of units the diver wants. It must be either
	 * m or ft
	 */
	public void setUnit(String unit){
		
		if(!unit.equals("m") && !unit.equals("ft")){
			System.out.println("You must input either 'm' or 'ft'.\nTry again");
			setCheck(-1);
		}
		else{
			this.unit = unit;
			setCheck(0);
			//System.out.println("Accepted");
		}
	}
	
   /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method for the break group
	 */
        public void setBreakGroup(char group){
            this.userBreakGroup = group;
        }
        
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method that will set the depth 
	 * 	the diver wants to go
	 */
	public void setDepth(int depth){
		userDepth = depth;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method that will set the time the 
	 * 	diver wants to go
	 */
	public void setTime(int time){
		userTime = time;
	}
        
        /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
         * A setter to set the break time for the user
         * @param time 
         */
        public void setBreakTime(int time){
                userBreakTime = time;
        }
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method that will set which group
	 * 	the diver will belong to
	 * @param group
	 */
	public void setGroup(char group){
		userGroup = group;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A setter method that will set the decompress time
	 * 	for the divers
	 */
	public void setDecompress(int time){
		decompress = time;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A method that will calculate which dive group the user 
	 * 	will belong to
	 * If the user input is not acceptable, then check will equal -1. My idea is 
	 * 	that there will be a while loop in the user interface, and if check != 0
	 * 	then it will continuously ask the user until there is a valid input
	 * @param depth Depth of the dive
	 * @param time Time of the dive
	 */
	public void calculateGroup(int depth, int time){
		
		if(getUnit().equals("m")){ 																						//User inputs meters
			
			if(depth <= 0){																								//USER DEPTH IMPOSSIBLE
				System.out.println("You must input a depth greater than 0");
				setCheck(-1);
			}
			else if(depth > 40){																						//USER DEPTH HAZARDOUS
				System.out.println("Do not dive below 40 meters");
				setCheck(-1);
			}
			
			else if(depth <= 12){ 																						//USER DEPTH <= 12 METERS
				if(time <= 0){
					System.out.println("You must input a time greater than 0");
					setCheck(-1);
				}
				else if(time > 150){																					//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 150");
					setCheck(-1);
				}
				
				else if(time > 130 && time <= 150){																		//If user time is between 130-150
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() +" minutes at every 5m");
					setCheck(0);
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 110 && time <= 130){																		//If user time is between 110-130
					setCheck(0);
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 100 && time <= 110){																		//If user time is between 100-110
					setCheck(0);
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 80 && time <= 100){																		//If user time is between 80-100
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 70 && time <= 80){																		//If user time is between 70-80
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 70){																		//If user time is between 50-70
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//If user time is between 40-50
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//If user time is between 30-40
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//If user time is between 25-30
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 25){																		//If user time is between 15-25
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 15){																		//If user time is between 5-15
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//If user time is between 0-5
					setCheck(0);
					setGroup('A');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			
			else if(depth > 12 && depth <= 15) {																		//USER DEPTH BETWEEN 12-15 METERS
				
				if(time <= 0){
					System.out.println("You must input a time greater than 0");
					setCheck(-1);
				}
				else if(time > 100){																					//If user wants to input fatal parameters
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 100");
					setCheck(-1);				
				}
				else if(time > 80 && time <= 100){																		//If user time is between 80-100
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setCheck(0);
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 70 && time <=80){																		//If user time is between 70-80
					setCheck(0);
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 60 && time <=70){																		//If user time is between 60-70
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <=60){																		//If user time is between 50-60
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <=50){																		//If user time is between 40-50
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <=40){																		//If user time is between 30-40
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <=30){																		//If user time is between 25-30
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <=25){																		//If user time is between 15-25
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <=15){																		//If user time is between 10-15
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 15 && depth <= 18){																			//DEPTH BETWEEN 15 AND 18 METERS
				
				if(time <= 0){																							//User input cannot be negative
					setCheck(-1);
					System.out.println("You must input a time greater than 0");
				}
				else if(time > 80){																						//Hazardous user time
					setCheck(-1);
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 80");
				}
				else if(time > 60 && time <= 80){																		//User time between 60-80
					setCheck(0);
					setGroup('L');
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 55 && time <= 60){																		//User time between 55-60
					setCheck(0);
					setGroup('J');
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 55){																		//User time between 50-55
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//User time between 30-40
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15	
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			
			else if(depth > 18 && depth <= 21){																			//DEPTH BETWEEN 18 AND 21 METERS
				
				if(time <= 0){																							//User input cannot be negative
					setCheck(-1);
					System.out.println("You must input a time greater than 0");
				}
				else if(time > 70){																						//Hazardous user time
					setCheck(-1);
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 70");
				}
				else if(time > 60 && time <= 70){																		//User time between 60-70
					setCheck(0);
					setDecompress(14);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 60){																		//User time between 50-60
					setCheck(0);
					setDecompress(8);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 45 && time <= 50){																		//User time between 45-50
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 45){																		//User time between 40-45
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 35 && time <= 40){																		//User time between 35-40
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 35){																		//User time between 30-35
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 30){																		//User time between 20-30
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 21 && depth <= 24){																			//DEPTH BETWEEN 21-24 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 60){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 60");
					setCheck(-1);
				}
				else if(time > 50 && time <= 60){																		//User time between 50-60
					setCheck(0);
					setDecompress(17);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setDecompress(10);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 35 && time <= 40){																		//User time between 35-40
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 35){																		//User time between 30-35
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());	
				}
			}
			else if(depth > 24 && depth <= 27){																			//DEPTH BETWEEN 24-27 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 50){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 50");
					setCheck(-1);
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setDecompress(18);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//User time between 30-40
					setCheck(0);
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 12 && time <= 15){																		//User time between 12-15
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 12){																		//User time between 10-12
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 27 && depth <= 30){																			//DEPTH BETWEEN 27-30 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 40){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 40");
					setCheck(-1);
				}
				else if(time > 25 && time <= 40){																		//User time between 25-40
					setCheck(0);
					setDecompress(15);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 22 && time <= 25){																		//User time between 22-25
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 22){																		//User time between 20-22
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 7 && time <= 10){																		//User time between 7-10
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 7){																			//User time between 5-7
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 30 && depth <= 33){																			//DEPTH BETWEEN 30-33 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 30){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 30");
					setCheck(-1);
				}
				else if(time > 20 && time <= 30){																		//User time between 20-30
					setCheck(0);
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 13 && time <= 15){																		//User time between 13-15
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 13){																		//User time between 10-13
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-7
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 33 && depth <= 36){																			//DEPTH BETWEEN 33-36 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 30){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 30");
					setCheck(-1);
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setDecompress(14);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 25){																		//User time between 15-25
					setCheck(0);
					setDecompress(6);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 12 && time <= 15){																		//User time between 12-15
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 12){																		//User time between 10-12
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 36 && depth <= 40){																			//DEPTH BETWEEN 36-40 METERS
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 25){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 25");
					setCheck(-1);
				}
				else if(time > 10 && time <= 25){																		//User time between 10-25
					setCheck(0);
					setDecompress(10);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 8 && time <= 10){																		//User time between 8-10
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 5 meters");
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 8){																			//User time between 5-8
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
		}
		
		else{																											//USER INPUT = FEET
			
			if(depth <= 0){																								//USER DEPTH IMPOSSIBLE
				System.out.println("You must input a depth greater than 0");
				setCheck(-1);
			}
			else if(depth > 130){																						//USER DEPTH HAZARDOUS
				System.out.println("Do not dive below " + depth + " " + getUnit());
				setCheck(-1);
			}
			else if(depth <= 40){ 																						//USER DEPTH <= 40 FEET
				if(time <= 0){
					System.out.println("You must input a time greater than 0");
					setCheck(-1);
				}
				else if(time > 150){																					//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 150");
					setCheck(-1);
				}
				
				else if(time > 130 && time <= 150){																		//If user time is between 130-150
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() +" minutes at every 15 feet");
					setCheck(0);
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 110 && time <= 130){																		//If user time is between 110-130
					setCheck(0);
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 100 && time <= 110){																		//If user time is between 100-110
					setCheck(0);
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 80 && time <= 100){																		//If user time is between 80-100
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 70 && time <= 80){																		//If user time is between 70-80
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 70){																		//If user time is between 50-70
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//If user time is between 40-50
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//If user time is between 30-40
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//If user time is between 25-30
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 25){																		//If user time is between 15-25
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 15){																		//If user time is between 5-15
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//If user time is between 0-5
					setCheck(0);
					setGroup('A');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 40 && depth <= 50) {																		//USER DEPTH BETWEEN 40-50 FEET
				
				if(time <= 0){
					System.out.println("You must input a time greater than 0");
					setCheck(-1);
				}
				else if(time > 100){																					//If user wants to input fatal parameters
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 100");
					setCheck(-1);				
				}
				else if(time > 80 && time <= 100){																		//If user time is between 80-100
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setCheck(0);
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 70 && time <=80){																		//If user time is between 70-80
					setCheck(0);
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 60 && time <=70){																		//If user time is between 60-70
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <=60){																		//If user time is between 50-60
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <=50){																		//If user time is between 40-50
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <=40){																		//If user time is between 30-40
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <=30){																		//If user time is between 25-30
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <=25){																		//If user time is between 15-25
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <=15){																		//If user time is between 10-15
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 50 && depth <= 60){																			//DEPTH BETWEEN 50-60 FEET
				
				if(time <= 0){																							//User input cannot be negative
					setCheck(-1);
					System.out.println("You must input a time greater than 0");
				}
				else if(time > 80){																						//Hazardous user time
					setCheck(-1);
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 80");
				}
				else if(time > 60 && time <= 80){																		//User time between 60-80
					setCheck(0);
					setGroup('L');
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 55 && time <= 60){																		//User time between 55-60
					setCheck(0);
					setGroup('J');
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 55){																		//User time between 50-55
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//User time between 30-40
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15	
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 60 && depth <= 70){																			//DEPTH BETWEEN 60-70 FEET
				
				if(time <= 0){																							//User input cannot be negative
					setCheck(-1);
					System.out.println("You must input a time greater than 0");
				}
				else if(time > 70){																						//Hazardous user time
					setCheck(-1);
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 70");
				}
				else if(time > 60 && time <= 70){																		//User time between 60-70
					setCheck(0);
					setDecompress(14);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 50 && time <= 60){																		//User time between 50-60
					setCheck(0);
					setDecompress(8);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 45 && time <= 50){																		//User time between 45-50
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 45){																		//User time between 40-45
					setCheck(0);
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 35 && time <= 40){																		//User time between 35-40
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 35){																		//User time between 30-35
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 30){																		//User time between 20-30
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 70 && depth <= 80){																			//DEPTH BETWEEN 70-80 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 60){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 60");
					setCheck(-1);
				}
				else if(time > 50 && time <= 60){																		//User time between 50-60
					setCheck(0);
					setDecompress(17);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setDecompress(10);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 35 && time <= 40){																		//User time between 35-40
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 35){																		//User time between 30-35
					setCheck(0);
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());	
				}
			}
			else if(depth > 80 && depth <= 90){																			//DEPTH BETWEEN 80-90 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 50){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 50");
					setCheck(-1);
				}
				else if(time > 40 && time <= 50){																		//User time between 40-50
					setCheck(0);
					setDecompress(18);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('L');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 30 && time <= 40){																		//User time between 30-40
					setCheck(0);
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 25){																		//User time between 20-25
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 12 && time <= 15){																		//User time between 12-15
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 12){																		//User time between 10-12
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 90 && depth <= 100){																		//DEPTH BETWEEN 90-100 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 40){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 40");
					setCheck(-1);
				}
				else if(time > 25 && time <= 40){																		//User time between 25-40
					setCheck(0);
					setDecompress(15);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('K');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 22 && time <= 25){																		//User time between 22-25
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('H');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 20 && time <= 22){																		//User time between 20-22
					setCheck(0);
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 15){																		//User time between 10-15
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 7 && time <= 10){																		//User time between 7-10
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 7){																			//User time between 5-7
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('B');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 100 && depth <= 110){																		//DEPTH BETWEEN 100-110 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 30){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 30");
					setCheck(-1);
				}
				else if(time > 20 && time <= 30){																		//User time between 20-30
					setCheck(0);
					setDecompress(7);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 20){																		//User time between 15-20
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('G');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 13 && time <= 15){																		//User time between 13-15
					setCheck(0);
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 13){																		//User time between 10-13
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-7
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 110 && depth <= 120){																		//DEPTH BETWEEN 110-120 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 30){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 30");
					setCheck(-1);
				}
				else if(time > 25 && time <= 30){																		//User time between 25-30
					setCheck(0);
					setDecompress(14);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 15 && time <= 25){																		//User time between 15-25
					setCheck(0);
					setDecompress(6);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('I');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 12 && time <= 15){																		//User time between 12-15
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('F');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 10 && time <= 12){																		//User time between 10-12
					setCheck(0);
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 10){																		//User time between 5-10
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
			else if(depth > 120 && depth <= 130){																		//DEPTH BETWEEN 120-130 FEET
				
				if(time <= 0){																							//Impossible depth time
					System.out.println("You must input a time greater than 0");	
					setCheck(-1);
				}
				else if(time > 25){																						//If user wants to die
					System.out.println("Dive time for " + depth + getUnit() + " should not be greater than 25");
					setCheck(-1);
				}
				else if(time > 10 && time <= 25){																		//User time between 10-25
					setCheck(0);
					setDecompress(10);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('J');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 8 && time <= 10){																		//User time between 8-10
					setCheck(0);
					setDecompress(5);
					System.out.println("Decompress for " + getDecompress() + " minutes at every 15 feet");
					setGroup('E');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else if(time > 5 && time <= 8){																			//User time between 5-8
					setCheck(0);
					setGroup('D');
					System.out.println("Dive Group: " + getDiveGroup());
				}
				else{																									//User time between 1-5
					setCheck(0);
					setGroup('C');
					System.out.println("Dive Group: " + getDiveGroup());
				}
			}
		}
	}
        
        public boolean diveCheck(int depth, int unit, int time, char group, boolean repetiveDive){
            setDepth(depth);
            setTime(time);
            setBreakGroup(group);
            return diveCheck(unit, repetiveDive);   
        }
        
         /**
         * DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
         * diveCheck:Checks to see if the dive is possible or not based on the criteria
         * @param unit
         * @param repetiveDive
         * @return 
         */
	public boolean diveCheck(int unit, boolean repetiveDive){
            int depth = this.userDepth;
            int time = this.userTime;
            char group = this.userBreakGroup;
            
            //Units are in meters, convert the depth to feet
		if(unit == 1){
			depth = (int) (depth * 3.2);
		}
                
                //If the dive is repetive, then the group is from the residualNitrogen
		if(repetiveDive)time += residualNitrogenCalc(group, depth, unit);
	  
		//All of the comparisons will be done with the depth in feet.
		//If the depth is over 130 feet or the time is over 150 min, dive is no possible.
    if(depth > 130 || time > 150){
			return false;
		}
    //Else if the depth is below or equal to 40 and the time greater than 150,
    //dive is not possible
		else if(depth <= 40 && time > 150){
			return false;
		}
    //else if the depth if below or equal to 50 and the time is greater than 100,
    //dive is not possible
		else if(depth > 40 && depth <= 50 && time > 100){
			return false;
		}
    //else if the depth is below or equal to 60 and the time is greater than 80,
    //dive is not possible
		else if(depth > 50 && depth <= 60 && time > 80){
			return false;
		}
    //else if the depth is below or equal to 70 and the time is greater than 70,
    //dive is not possible
		else if(depth > 60 && depth <= 70 && time > 70){
			return false;
		}
    //else if the depth is below or equal to 80 and the time is greater than 60,
    //dive is not possible
		else if(depth > 70 && depth <= 80 && time > 60){
			return false;
		}
    //else if depth is below or equal to 90 and the time is greater than 50,
    //dive is not possible
		else if(depth > 80 && depth <= 90 && time > 50){
			return false;
		}
    //else if the depth if below or equal to 100 and the time is greater than 40,
    //dive is not possible
		else if(depth > 90 && depth <= 100 && time > 40){
			return false;
		}
    //else if the depth if below or equal to 110 and the time is greater than 30,
    //dive is not possible
		else if(depth > 100 && depth <= 110 && time > 30){
			return false;
		}
    //else if the depth is below or equal to 120 and the time is greater than 30
    //dive is not possible
		else if(depth > 110 && depth <= 120 && time > 30){
			return false;
		}
    //else if the dpeth is below or equal to 130 and the time is greater than 25
    //dive is not possible
		else if(depth > 120 && depth <= 130 && time > 25){
			return false;
		}
    //else the dive is possible
		else{
			return true;
		}
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * 
	 * Checks if the dive requires decompression stops.
	 * 
	 * 
	 * @return the amount of time that is needed for a decompression stop at every 15 feet.
	 */
	public int diveDecompressionStopTime(int depth, int unit, int time, String group){
		int returnTime = 0;
		
		if(unit == 1){
			depth = (int) (depth * 3.2);
		}
                time += residualNitrogenCalc(group.charAt(0), depth, unit);
		
		//Depth is done in feet
                if(depth == 0){
                }
                else if(depth <= 40 && (time > 130 && time <= 150)){
			returnTime = 5;
		}
		else if(depth <= 50 && depth > 40 &&(time > 80 && time <= 100)){
			returnTime = 5;
		}
		else if(depth <= 60 && depth > 50 && (time > 55 && time <= 60)){
			returnTime = 5;
		}
		else if(depth <= 60 && depth > 50 && (time > 60 && time <= 80)){
			returnTime = 7;
		}
		else if(depth <= 70 && depth > 60 && (time > 45 && time <= 50)){
			returnTime = 5;
		}
		else if(depth <= 70 && depth > 60 && (time > 50 && time <= 60)){
			returnTime = 8;
		}
		else if(depth <= 70 && depth > 60 && (time > 60 && time <= 70)){
			returnTime = 14;
		}
		else if(depth <= 80 && depth > 70 && (time > 35 && time <= 40)){
			returnTime = 5;
		}
		else if(depth <= 80 && depth > 70 && (time > 40 && time <= 50)){
			returnTime = 10;
		}
		else if( depth <= 80 && depth > 70 && (time > 50 && time <= 60)){
			returnTime = 17;
		}
		else if(depth <= 90 && depth > 80 && (time > 25 && time <= 30)){
			returnTime = 5;
		}
		else if(depth <= 90 && depth > 80 && (time > 30 && time <= 40)){
			returnTime = 7;
		}
		else if(depth <= 90 && depth > 80  && (time > 40 && time <= 50)){
			returnTime = 18;
		}
		else if(depth <= 100 && depth > 90 && (time > 22 && time <= 25)){
			returnTime = 5;
		}
		else if(depth <= 100 && depth > 90 && (time > 25 && time <= 40)){
			returnTime = 15;
		}
		else if( depth <= 110 && depth > 100 && (time > 15 && time <= 20)){
			returnTime = 5;
		}
		else if( depth <= 110 && depth > 100 && (time > 20 && time <= 30)){
			returnTime = 7;
		}
		else if( depth <= 120 && depth > 110 && (time > 12 && time <= 15)){
			returnTime = 5;
		}
		else if(depth <= 120&& depth > 110 && (time > 15 && time <= 25)){
			returnTime = 6;
		}
		else if( depth <= 120 && depth > 110 && (time > 25 && time <= 30)){
			returnTime = 14;
		}
		else if(depth <= 130 && depth > 120 && depth > 120 && (time > 8 && time <= 10)){
			returnTime = 5;
		}
		else if(depth <= 130 && depth > 120 && (time > 10 && time <= 25)){
			returnTime = 10;
		}
		return returnTime;
	}
  
        /** DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
         * residualNitrogenCalc: takes in the group, depth, and unit
	 * and calculates the amount of residual nitrogen the user has
	 * based on those inputs
	 * 
	 */
	private int residualNitrogenCalc(char group, int depth, int unit){
		//convert from meters to feet. All calculations will be done in feet
		if(unit == 1){
			depth = (int) (depth * 3.2);
		}
		
		//Group A calculations
		if(group == 'A' && depth > 0 && depth <= 40){
			return 7;
		}
		
		else if(group == 'A' && depth > 40 && depth <= 50){
			return 6;
		}
		else if(group == 'A' && depth > 50 && depth <= 60){
			return 5;
		}
		else if (group == 'A' && depth > 60 && depth <= 70){
			return 4;
		}
		else if(group == 'A' && depth > 70 && depth <= 80){
			return 4;
		}
		else if(group == 'A' && depth > 80 && depth <= 90){
			return 3;
		}
		else if(group == 'A' && depth > 90 &&depth <= 100){
			return 3;
		}
		else if(group == 'A' &&depth > 100 && depth <= 110){
			return 3;
		}
		else if(group == 'A' && depth > 110 &&depth <= 120){
			return 3;
		}
		else if(group == 'A' &&depth > 120 &&depth <= 130){
			return 3;
		}
		
		//group B calculations
		else if(group == 'B' && depth <= 40){
			return 17;
		}
		else if(group == 'B' && depth <= 50){
			return 13;
		}
		else if(group == 'B' && depth <= 60){
			return 11;
		}
		else if(group == 'B' && depth <= 70){
			return 9;
		}
		else if(group == 'B' && depth <= 80){
			return 8;
		}
		else if(group == 'B' && depth <= 90){
			return 7;
		}
		else if(group == 'B' && depth <= 100){
			return 7;
		}
		else if(group == 'B' && depth <= 110){
			return 6;
		}
		else if(group == 'B' && depth <= 120){
			return 6;
		}
		else if (group == 'B' && depth <= 130){
			return 6;
		}
		
		//Group C calculations
		else if(group == 'C' && depth <= 40){
			return 25;
		}
		else if(group == 'C' && depth <= 50){
			return 21;
		}
		else if(group == 'C' && depth <= 60){
			return 17;
		}
		else if(group == 'C' && depth <= 70){
			return 15;
		}
		else if(group == 'C' && depth <= 80){
			return 13;
		}
		else if(group == 'C' && depth <= 90){
			return 11;
		}
		else if(group == 'C' && depth <= 100){
			return 10;
		}
		else if(group == 'C' && depth <= 110){
			return 10;
		}
		else if(group == 'C' && depth <= 120){
			return 9;
		}
		else if (group == 'C' && depth <= 130){
			return 8;
		}
		
		//Group D calculations
		else if(group == 'D' && depth <= 40){
			return 37;
		}
		else if(group == 'D' && depth <= 50){
			return 29;
		}
		else if(group == 'D' && depth <= 60){
			return 24;
		}
		else if(group == 'D' && depth <= 70){
			return 20;
		}
		else if(group == 'D' && depth <= 80){
			return 18;
		}
		else if(group == 'D' && depth <= 90){
			return 16;
		}
		else if(group == 'D' && depth <= 100){
			return 14;
		}
		else if(group == 'D' && depth <= 110){
			return 13;
		}
		else if(group == 'D' && depth <= 120){
			return 12;
		}
		else if (group == 'D' && depth <= 130){
			return 11;
		}
		
		//Group E calculations
		else if(group == 'E' && depth <= 40){
			return 49;
		}
		else if(group == 'E' && depth <= 50){
			return 38;
		}
		else if(group == 'E' && depth <= 60){
			return 30;
		}
		else if(group == 'E' && depth <= 70){
			return 26;
		}
		else if(group == 'E' && depth <= 80){
			return 23;
		}
		else if(group == 'E' && depth <= 90){
			return 20;
		}
		else if(group == 'E' && depth <= 100){
			return 18;
		}
		else if(group == 'E' && depth <= 110){
			return 16;
		}
		else if(group == 'E' && depth <= 120){
			return 15;
		}
		else if (group == 'E' && depth <= 130){
			return 13;
		}
		
		//Group F calculations
		else if(group == 'F' && depth <= 40){
			return 61;
		}
		else if(group == 'F' && depth <= 50){
			return 47;
		}
		else if(group == 'F' && depth <= 60){
			return 36;
		}
		else if(group == 'F' && depth <= 70){
			return 31;
		}
		else if(group == 'F' && depth <= 80){
			return 28;
		}
		else if(group == 'F' && depth <= 90){
			return 24;
		}
		else if(group == 'F' && depth <= 100){
			return 22;
		}
		else if(group == 'F' && depth <= 110){
			return 20;
		}
		else if(group == 'F' && depth <= 120){
			return 18;
		}
		else if (group == 'F' && depth <= 130){
			return 16;
		}
		
		//Group G Calculations
		else if(group == 'G' && depth <= 40){
			return 73;
		}
		else if(group == 'G' && depth <= 50){
			return 56;
		}
		else if(group == 'G' && depth <= 60){
			return 44;
		}
		else if(group == 'G' && depth <= 70){
			return 37;
		}
		else if(group == 'G' && depth <= 80){
			return 32;
		}
		else if(group == 'G' && depth <= 90){
			return 29;
		}
		else if(group == 'G' && depth <= 100){
			return 26;
		}
		else if(group == 'G' && depth <= 110){
			return 24;
		}
		else if(group == 'G' && depth <= 120){
			return 21;
		}
		else if (group == 'G' && depth <= 130){
			return 19;
		}
		
		//Group H calculations
		else if(group == 'H' && depth <= 40){
			return 87;
		}
		else if(group == 'H' && depth <= 50){
			return 66;
		}
		else if(group == 'H' && depth <= 60){
			return 52;
		}
		else if(group == 'H' && depth <= 70){
			return 43;
		}
		else if(group == 'H' && depth <= 80){
			return 38;
		}
		else if(group == 'H' && depth <= 90){
			return 33;
		}
		else if(group == 'H' && depth <= 100){
			return 30;
		}
		else if(group == 'H' && depth <= 110){
			return 27;
		}
		else if(group == 'H' && depth <= 120){
			return 25;
		}
		else if (group == 'H' && depth <= 130){
			return 22;
		}
		//Group I calculations
		else if(group == 'I' && depth <= 40){
			return 101;
		}
		else if(group == 'I' && depth <= 50){
			return 76;
		}
		else if(group == 'I' && depth <= 60){
			return 61;
		}
		else if(group == 'I' && depth <= 70){
			return 50;
		}
		else if(group == 'I' && depth <= 80){
			return 43;
		}
		else if(group == 'I' && depth <= 90){
			return 38;
		}
		else if(group == 'I' && depth <= 100){
			return 34;
		}
		else if(group == 'I' && depth <= 110){
			return 31;
		}
		else if(group == 'I' && depth <= 120){
			return 28;
		}
		else if(group == 'I' && depth <= 130){
			return 25;
		}
		
		//Group J calculations
		else if(group == 'J' && depth <= 40){
			return 116;
		}
		else if(group == 'J' && depth <= 50){
			return 87;
		}
		else if(group == 'J' && depth <= 60){
			return 70;
		}
		else if(group == 'J' && depth <= 70){
			return 57;
		}
		else if(group == 'J' && depth <= 80){
			return 48;
		}
		else if(group == 'J' && depth <= 90){
			return 43;
		}
		else if(group == 'J' && depth <= 100){
			return 38;
		}
		
		//Group K Calculations
		else if(group == 'K' && depth <= 40){
			return 138;
		}
		else if(group == 'K' && depth <= 50){
			return 99;
		}
		else if(group == 'K' && depth <= 60){
			return 79;
		}
		else if(group == 'K' && depth <= 70){
			return 64;
		}
		else if(group == 'K' && depth <= 80){
			return 54;
		}
		else if(group == 'K' && depth <= 90){
			return 47;
		}
		
		//Group L calculations
		else if(group == 'L' && depth <= 40){
			return 161;
		}
		else if(group == 'L' && depth <= 50){
			return 111;
		}
		else if(group == 'L' && depth <= 60){
			return 88;
		}
		else if(group == 'L' && depth <= 70){
			return 72;
		}
		else if(group == 'L' && depth <= 80){
			return 61;
		}
		else if(group == 'L' && depth <= 90){
			return 53;
		}
		else if(group == 'B' && depth <= 100){
			return 7;
		}
		
		else{
			return 0;
		}
	}
        
        
        /**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * 
	 * @return char that contains the group letter for the repetive dive table that is capatalized. If 0, then the break time is invalid 
	 */
	public void breakGroupCalculator(){
		if(this.userBreakTime < 10){
		}
		else if(this.userBreakTime > 553 || this.userGroup == 'A'){
			this.userBreakGroup = 'A';
		}
		else{
			 this.userBreakGroup  = breakGroupCalculate();
		}
	}
	
	/** DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * 
	 * Private method for caculating the 
	 * @return char that contains the group letter for the repetive dive table that is capatalized.  
	 */
	private char breakGroupCalculate(){
		char returnGroup = 0;
		char group = this.userGroup;
                int time = this.userBreakTime;
		if(group == 'B'){
			if(time >= 201){
				returnGroup = 'A';
			}
			else if(time <= 200){
				returnGroup = 'B';
			}
			
		}
		else if(group == 'C'){
			if(time >= 290){
				returnGroup = 'A';
			}
			else if(time <= 289 && time >= 100){
				returnGroup = 'B';
			}
			else{
				returnGroup = 'C';
			}
		}
		else if(group == 'D'){
			if(time >= 349){
				returnGroup = 'A';
			}
			else if(time <= 348 && time >= 159){
				returnGroup = 'B';
			}
			else if(time <= 158 && time >= 70){
				returnGroup = 'C';
			}
			else{
				returnGroup = 'D';
			}
		}
		else if(group == 'E'){
			if(time >= 395){
				returnGroup = 'A';
			}
			else if(time <= 394 && time > 204){
				returnGroup = 'B';
			}
			else if(time <= 204 && time >= 118){
				returnGroup = 'C';
			}
			else if(time <= 117 && time >= 55){
				returnGroup = 'D';
			}
			else{
				returnGroup = 'E';
			}
		}
		else if(group == 'F'){
			if(time >= 426){
				returnGroup = 'A';
			}
			else if(time <= 425 && time >= 238){
				returnGroup = 'B';
			}
			else if(time <= 237 && time >= 149){
				returnGroup = 'C';
			}
			else if(time <= 148 && time >= 90){
				returnGroup = 'D';
			}
			else if(time <= 89 && time >= 46){
				returnGroup = 'E';
			}
			else{
				returnGroup = 'F';
			}
		}
		else if(group == 'G'){
			if(time >= 456){
				returnGroup = 'A';
			}
			else if(time <= 455 && time >= 266){
				returnGroup = 'B';
			}
			else if(time <= 265 && time >= 179){
				returnGroup = 'C';
			}
			else if(time <= 178 && time >= 120){
				returnGroup = 'D';
			}
			else if(time <= 119 && time >= 76){
				returnGroup = 'E';
			}
			else if(time <= 75 && time >= 41){
				returnGroup = 'F';
			}
			else{
				returnGroup = 'G';
			}
		}
		else if(group == 'H'){
			if(time >= 480){
				returnGroup = 'A';
			}
			else if(time <= 479 && time >= 290){
				returnGroup = 'B';
			}
			else if(time <= 289 && time >= 201){
				returnGroup = 'C';
			}
			else if(time <= 200 && time >= 144){
				returnGroup = 'D';
			}
			else if(time <= 143 && time >= 102){
				returnGroup = 'E';
			}
			else if(time <= 101 && time >= 67){
				returnGroup = 'F';
			}
			else if(time <= 66 && time >= 37){
				returnGroup = 'G';
			}
			else{
				returnGroup = 'H';
			}
		}
		else if(group == 'I'){
			if(time >= 502){
				returnGroup = 'A';
			}
			else if(time <= 501 && time >= 313){
				returnGroup = 'B';
			}
			else if(time <= 312 && time >= 224){
				returnGroup = 'C';
			}
			else if(time <= 223 && time >= 165){
				returnGroup = 'D';
			}
			else if(time <= 164 && time >= 123){
				returnGroup = 'E';
			}
			else if(time <= 122 && time >= 90){
				returnGroup = 'F';
			}
			else if(time <= 89 && time >= 60){
				returnGroup = 'G';
			}
			else if(time <= 59 && time >= 34){
				returnGroup = 'H';
			}
			else{
				returnGroup = 'I';
			}
		}
		else if(group == 'J'){
			if(time >= 531){
				returnGroup = 'A';
			}
			else if(time <= 530 && time >= 341){
				returnGroup = 'B';
			}
			else if(time <= 340 && time >= 243){
				returnGroup = 'C';
			}
			else if(time <= 242 && time >= 185){
				returnGroup = 'D';
			}
			else if(time <= 184 && time >= 141){
				returnGroup = 'E';
			}
			else if(time <= 140 && time >= 108){
				returnGroup = 'F';
			}
			else if(time <= 107 && time >= 80){
				returnGroup = 'G';
			}
			else if(time <= 79 && time >= 55){
				returnGroup = 'H';
			}
			else if(time <= 54 && time >= 32){
				returnGroup = 'I';
			}
			else{
				returnGroup = 'J';
			}
		}
		else if(group == 'K'){
			if(time >= 539){
				returnGroup = 'A';
			}
			else if(time <= 538 && time >= 349){
				returnGroup = 'B';
			}
			else if(time <= 348 && time >= 260){
				returnGroup = 'C';
			}
			else if(time <= 259 && time >= 202){
				returnGroup = 'D';
			}
			else if(time <= 201 && time >= 159){
				returnGroup = 'E';
			}
			else if(time <= 158 && time >= 124){
				returnGroup = 'F';
			}
			else if(time <= 123 && time >= 96){
				returnGroup = 'G';
			}
			else if(time <= 95 && time >= 72){
				returnGroup = 'H';
			}
			else if(time <= 71 && time >= 50){
				returnGroup = 'I';
			}
			else if(time <= 49 && time >= 29){
				returnGroup = 'J';
			}
			else{
				returnGroup = 'K';
			}
		}
		else {
			if(time >= 553){
				returnGroup = 'A';
			}
			else if(time <= 552 && time >= 363){
				returnGroup = 'B';
			}
			else if(time <= 362 && time >= 276){
				returnGroup = 'C';
			}
			else if(time <= 275 && time >= 217){
				returnGroup = 'D';
			}
			else if(time <= 216 && time >= 174){
				returnGroup = 'E';
			}
			else if(time <= 173 && time >= 140){
				returnGroup = 'F';
			}
			else if(time <= 139 && time >= 110){
				returnGroup = 'G';
			}
			else if(time <= 109 && time >= 86){
				returnGroup = 'H';
			}
			else if(time <= 85 && time >= 65){
				returnGroup = 'I';
			}
			else if(time <= 64 && time >= 46){
				returnGroup = 'J';
			}
			else if(time <= 45 && time >= 27){
				returnGroup = 'K';
			}
			else{
				returnGroup = 'L';
			}	
		}
		return returnGroup;
	}
	
	/**DISCLAIMER: This is a PROTOTYPE and must NOT be used to plan real dives.
	 * A method that will print out the user's planned depth
	 * 	and dive time
	 */
	public void printUserInputs(){
		System.out.println("Depth: " + getUserDepth() + getUnit());
		System.out.println("Time: " + getUserTime() + " minutes");
	}
	
}
